﻿using UI;
using UnityEngine;

public class FormOperationAction : MonoBehaviour
{
    [SerializeField]
    private string _formName;

    private UIForm _form;


    public void Open()
    {
        if (_form == null)
        {
            _form = UISystem.Open(_formName);
        }
        else
        {
            _form.Open();
        }
    }

    public void Close()
    {
        if (_form == null)
        {
            UISystem.Close(_formName);
        }
        else
        {
            _form.Close();
            _form = null;
        }
    }
}
